const fs = require('fs');
const globalSwitch = false;

module.exports = async function restore(checkpointName) {
  if (globalSwitch) {
    const filename = `./zp_${checkpointName}.ckp.log`;
    if (fs.existsSync(filename)) {
      const raw = fs.readFileSync(filename);
      return JSON.parse(raw);
    } else {
      return false;
    }
  } else {
    return false;
  }
};